﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace TeacherLeftHand.Util
{
    public class TranslationData : INotifyPropertyChanged
    {
        private string _key;
        //private TranslationManager manager;

        public TranslationData(string key)
        {
            _key = key;
            if (TranslationManager.Instance != null)
                TranslationManager.Instance.LanguageChanged += new EventHandler(OnLanguageChanged);
        }

        public object Value
        {
            get
            {
                return TranslationManager.Instance.Translate(_key);
            }
        }

        private void OnLanguageChanged(object sender, EventArgs e)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs("Value"));
            }
        }

        #region INotifyPropertyChanged Memeber
        public event PropertyChangedEventHandler PropertyChanged;
        #endregion // INotifyPropertyChanged Memeber
    }
}
